<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="css/aui.css">
    <link rel="stylesheet" href="css/swiper.min.css">
    <script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
    <script type="text/javascript" src="js/init.js"></script>
    <title>主页</title>
    <style>
        .swiper-container {
            width: 100%;
            /*height: 100%*/
        }
        .swiper-slide {
            text-align: center;
            font-size: 18px;
            background: #fff;

            /* Center slide text vertically */
            display: -webkit-box;
            display: -ms-flexbox;
            display: -webkit-flex;
            display: flex;
            -webkit-box-pack: center;
            -ms-flex-pack: center;
            -webkit-justify-content: center;
            justify-content: center;
            -webkit-box-align: center;
            -ms-flex-align: center;
            -webkit-align-items: center;
            align-items: center;
        }
        .swiper-slide img{
            width: 100%;
        }
    </style>
</head>
<body>
<section style="padding-top: 0">
    <!-- Swiper -->
    <div class="swiper-container">
        <div class="swiper-wrapper">

        </div>
        <!-- Add Pagination -->
        <div class="swiper-pagination"></div>
    </div>
    
    <div style="background: #f7f6fb;" class="flex">
        <img class="col-1 mar-l-r-2" src="img/notice.png" alt="">
        <marquee class=" pad-t-b-1" behavior="" direction="">
            <p id="notice">暂无公告...</p>
        </marquee>
    </div>
    

    <ul class="flex flex-r-w center">
        <a href="myinfo.html" class="col-25 pad-t-b-2">
            <img class="col-5 auto mar-b-1" src="img/index3.png" alt="">
            <p>个人资料</p>
            <p>개인 자료</p>
        </a>

        <a href="pay.html" class="col-25 pad-t-b-2">
            <img class="col-5 auto mar-b-1" src="img/index2.png" alt="">
            <p>充值中心</p>
            <p>충전 센터</p>
        </a>
        <a href="share.html" class="col-25 pad-t-b-2">
            <img class="col-5 auto mar-b-1" src="img/index1.png" alt="">
            <p>推广链接</p>
            <p>링크 보급</p>
        </a>
        <li class="col-25 pad-t-b-2" onclick="team()">
            <img class="col-5 auto mar-b-1" src="img/index4.png" alt="">
            <p>团队管理</p>
            <p>단체 관리</p>
        </li>

        <li class="col-25 pad-t-b-2" onclick="toast('敬请期待')">
            <img class="col-5 auto mar-b-1" src="img/index5.png" alt="">
            <p>商城</p>
            <p>상가</p>
        </li>
        <li class="col-25 pad-t-b-2" onclick="toast('敬请期待')">
            <img class="col-5 auto mar-b-1" src="img/index6.png" alt="">
            <p>操作攻略</p>
            <p>조작 공략</p>
        </li>
        <li class="col-25 pad-t-b-2" onclick="toast('暂无开放')">
            <img class="col-5 auto mar-b-1" src="img/index7.png" alt="">
            <p>交易所</p>
            <p>거래소</p>
        </li>
        <a href="kefu.html" class="col-25 pad-t-b-2">
            <img class="col-5 auto mar-b-1" src="img/index8.png" alt="">
            <p>客服中心</p>
            <p>고객센터</p>
        </a>
    </ul>

    <!--众筹进度-->
    <div class="flex pad-t-b-2">
        <a href="myItem.html?id=1" class="f1">
            <img class="col-10" src="img/b1.png" alt="">
        </a>
        <a href="myItem.html?id=3" class="f1">
            <img class="col-10" src="img/b2.png" alt="">
        </a>
        <a href="myItem.html?id=2" class="f1">
            <img class="col-10" src="img/b3.png" alt="">
        </a>

    </div>

    <ul id="news">
        <!--<li class="border-b-gray flex flex-y-s pad-2-3">
            <p class="f1 pad-r-2 ellipsis2">华克·经典永动1号第32期，现定于2019年7月22日北京时间15点08分准时开启众筹抢单。</p>
            <div class="color-blue">[2019-07-22]</div>
        </li>
        <li class="border-b-gray flex flex-y-s pad-2-3">
            <p class="f1 pad-r-2 ellipsis2">华克·经典永动1号第32期，现定于2019年7月22日北京时间15点08分准时开启众筹抢单。</p>
            <div class="color-blue">[2019-07-22]</div>
        </li>-->
    </ul>
</section>
<footer>
    <a href="#" class="f1 active">
        <img src="img/foot1.png" alt="">
        <p>主页</p>
    </a>
    <a href="zhongchou.html" class="f1">
        <img src="img/foot2.png" alt="">
        <p>众筹中心</p>
    </a>
    <a href="news.html" class="f1">
        <img src="img/foot3.png" alt="">
        <p>资讯</p>
    </a>
    <a href="my.html" class="f1">
        <img src="img/foot4.png" alt="">
        <p>个人</p>
    </a>
</footer>

<script src="js/swiper.min.js"></script>
<script>

    var data;
    function auto(url) {
        var u1 = 'index/banner/banner';
        var u2 = 'index/notice/index';
        var u3 = 'index/notice/noticelist';
        var u4 = 'index/Versions/getVersions';
        new AjaxRequest({
            type: 'post',
            dataType: 'json',
            url: hostUrl + url,
            data: data,
            callback: res => {
                console.log(url + res.data)
                if(res.status == 1){

                    if(url == u1){
                        var list = '';
                        for (var i=0;i<res.data.length;i++) {
                            list += '<div class="swiper-slide"><img src="'+res.data[i].banner_url+'" alt=""></div>'

                        }
                        $(".swiper-wrapper").html(list);
                    }
                    if(url == u2){
                        $("#notice").text(res.data.content)
                    }
                    if(url == u3){
                        var page = res.data.data;
                        var list = '';
                        for(var i=0;i<page.length;i++){
                            list += '<a href="newsDetail.html?id='+page[i].id+'" class="border-b-gray pad-2-3 block"><div class="color-blue pad-b-2">'+page[i].creattime+'</div><div class="ellipsis3">'+page[i].content+'</div></a>';
                        }
                        $("#news").html(list);
                    }
                    if(url == u4){


                    }

                    var swiper = new Swiper('.swiper-container', {
                        pagination: {
                            el: '.swiper-pagination',

                        },
                        autoplay: {
                            delay: 2500,
                            disableOnInteraction: false,
                        },
                    });

                }
            }
        })
    }

    // auto('index/Versions/getVersions');  //版本更新
    auto('index/banner/banner'); // 轮播
    auto('index/notice/index'); // 公告
    auto('index/notice/noticelist');  //新闻列表

    // 查看团队
    function team() {

        var data;
        new AjaxRequest({
            type: 'post',
            data: data,
            dataType: 'json',
            url: hostUrl + 'index/Team/teamcheck',
            callback: res => {

                if(res.status == 1){
                    window.location.href = 'myteam.html';

                }else{
                    toast(res.msg);
                }

            }
        });

    }


</script>
</body>

</html>

